package com.smart.adapter.impl;

import com.smart.enums.ChannelType;
import com.smart.service.ChannelService;

public class WebChannelAdapter implements ChannelService {
    @Override
    public String processMessage(String payload, ChannelType channelType) {
        // 网页渠道消息处理逻辑（表单/即时通讯）
        return "[WEB] Processed: " + payload.replaceAll("<script>", "");
    }

    @Override
    public String createSession(ChannelType channelType) {
        // 创建网页会话（含用户信息追踪）
        return "WEB-" + System.currentTimeMillis();
    }

    @Override
    public void closeSession(String sessionId) {
        // 记录网页会话结束日志
        System.out.println("Closing web session: " + sessionId);
    }
}